package com.open.pokergames.base.fragment;

import android.content.Context;

import androidx.annotation.NonNull;

import com.open.pokergames.R;
import com.sinothk.widget.loadingRecyclerView.LoadingRecyclerView;
import com.sinothk.widget.loadingRecyclerView.ProgressStyle;

import org.greenrobot.eventbus.EventBus;

import cn.sinothk.hussars.parent.LoadRecycleViewBaseFragment;

public abstract class EventBusRecycleViewBaseFragment<T> extends LoadRecycleViewBaseFragment<T> {

    @Override
    public void onAttach(@NonNull Context context) {
        super.onAttach(context);
        EventBus.getDefault().register(this);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }

    @Override
    protected void initRecycleLinearView(LoadingRecyclerView recyclerView) {
        super.initRecycleLinearView(recyclerView);
//        // 设置刷新样式
//        recyclerView.setRefreshProgressStyle(ProgressStyle.BallZigZag);
//        recyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallZigZag);
        // 设置刷新样式
        recyclerView.setRefreshProgressStyle(ProgressStyle.BallScaleRippleMultiple);
        recyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallScaleRippleMultiple);
    }

    @Override
    protected int getLineDrawable() {
        return R.drawable.list_divider;
    }
}
